<template>
	<view class="order">
		<view class="order_content" v-for="item in orderInfo">
			<view class="order_top">
				<text>{{item.department}}</text>
				<text>{{item.doctorName}}</text>
			</view>
			<view class="order_bottom">
				<text style="margin-right: 20rpx;">{{item.date}}</text>
				<text style="margin-right: 20rpx;">{{item.time}}</text>
				<text >{{item.state==='PAY'?'已支付':''}}</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			}
		},
		computed: {
			orderInfo() {
				return this.$store.state.m_user.userRegisted
			}
		},
		onLoad() {
			this.getUserRegisted()
		},
		methods: {
			getUserRegisted() {
				uni.$http.get('/order-server/api/order/v1/page?page=1&size=10').then(res => {
					console.log(res.data.data.current_data)
					this.$store.commit('m_user/updateUserRegisted', res.data.data.current_data)
				})
			}

		}
	}
</script>

<style>
	.order {
		padding: 20rpx;
	}

	.order_content {
		background-color: #ced6e0;
		height: 260rpx;
		border-radius: 8rpx;
		display: flex;
		flex-direction: column;
		justify-content: space-around;
		padding: 10rpx;
		font-size: 50rpx;
	}

	.order_top {
		margin-bottom: 15rpx;
		display: flex;
		text-align: center;
		line-height: 100rpx;
		padding-bottom: 10rpx;
		border-bottom: 1px solid #ccc;

	}

	.order_top text:nth-child(1) {
		height: 100rpx;
		border: 1px solid #ccc;
		padding: 0 20rpx;
	}

	.order_top text:nth-child(2) {
		padding: 0 20rpx;
		height: 100rpx;
		border: 1px solid #ccc;
	}
	.order_bottom{
		font-size: 30rpx;
	}
</style>
